package com.kaigejava.kgblog.web;

import com.github.pagehelper.PageInfo;
import com.kaigejava.kgblog.model.auto.TblAction;
import com.kaigejava.kgblog.service.ITblActionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by kaigejava on 2018/7/26.
 */
@Controller
@RequestMapping(value = "/action")
public class TblActionController {

    @Autowired
    private ITblActionService actionService;

    @ResponseBody
    @GetMapping("/all")
    public PageInfo<TblAction> findAll(@RequestParam(name = "pageNum", required = false, defaultValue = "1") int pageNum,
                                       @RequestParam(name = "pageSize", required = false, defaultValue = "10")  int pageSize){
        return  actionService.findAll(pageNum,pageSize);
    }
}
